import React, {useEffect} from "react";
import ReactDOM from "react-dom/client";
import {
    Provider,// 是一个组件，该组件拥有store属性，属性即是仓库
} from "react-redux";
import store from "./store";
import App from "./App";// createContext()

ReactDOM.createRoot(document.querySelector("#root")).render((
    <Provider store={store}>
        <App/>
    </Provider>

))



// function Provider(props){
//     const [state,setState] = useState(props.store.getState());
//     useEffect(()=>{
//         props.store.subscribe(()=>{
//             setState(props.store.getState());
//         })
//     },[])
//     return (
//         <div>
//             {props.children}
//         </div>
//     )
// }
